package com.cloudcc.mobile.parser;

import org.json.JSONObject;

import com.cloudcc.mobile.entity.comment.AddMicroCommentMessage;
import com.cloudcc.mobile.util.Tools;

public class AddMicroCommentParser {
	/**
	 * 解析发表回复返回的数据
	 * 
	 * @param json
	 * @return
	 */
	public static AddMicroCommentMessage addmicrocommnet(String json) {
		AddMicroCommentMessage msg = new AddMicroCommentMessage();
		try {
			JSONObject obj = new JSONObject(json);
			msg.setResult(obj.getBoolean("result"));
			msg.setReturnCode(obj.getString("returnCode"));
			msg.setReturnInfo(obj.getString("returnInfo"));
			JSONObject addmicro = obj.getJSONObject("data");
			String id = addmicro.getString("id");
			msg.setId(id);
		} catch (Exception e) {
			Tools.handle(e);
		}
		return msg;
	}
}
